#!/usr/bin/env python
# -*- coding:utf-8 -*-

from flask_restful import Api

from . import upvoteinfo_blueprint
from api_1_0.upvoteInfoResource.upvoteInfoResource import UpvoteInfoResource
from api_1_0.upvoteInfoResource.upvoteInfoOtherResource import UpvoteInfoOtherResource

api = Api(upvoteinfo_blueprint)

api.add_resource(UpvoteInfoResource, '/upvoteInfo/<AutoID>', '/upvoteInfo', endpoint='upvoteInfo')


# joint query
@upvoteinfo_blueprint.route('/upvoteInfo/query', methods=['GET'], endpoint='upvoteInfo_query')
def UpvoteInfo_query():
    return UpvoteInfoOtherResource.joint_query()

#点赞
@upvoteinfo_blueprint.route('/upvoteInfo/upvote', methods=['POST'], endpoint='upvoteInfo_upvote')
def UpvoteInfo_upvote():
    return UpvoteInfoOtherResource.upvote()

#取消点赞
@upvoteinfo_blueprint.route('/upvoteInfo/cancelupvote', methods=['DELETE'], endpoint='upvoteInfo_cancelupvote')
def UpvoteInfo_cancelupvote():
    return UpvoteInfoOtherResource.cancelupvote()
